Skip to content

refactor: Rename edge-selector arguments to edges - #2943

Merged
schochastics merged 30 commits into
claude/issue-2788-subagents-faw1t1-6from
claude/issue-2788-subagents-faw1t1-7
Dec 3, 2026
Merged

schochastics merged 30 commits into
claude/issue-2788-subagents-faw1t1-6from
claude/issue-2788-subagents-faw1t1-7

Conversation

@schochastics

@schochastics schochastics commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2788 (PR 7 of the stack, on top of #2864). It implements the edge mirror of the selector decision: vertices/edges for subsets and vertex/edge for a single element (krlmlr's last comment in #2788: "vertex/edge and vertices/edges, the alternative v/e and vv/ee is weird").

What this does

Renames the edge-subset selector to edges in 10 functions:

  • eids → edges: count_multiple(), reverse_edges(), subgraph_from_edges(), which_loop(), which_multiple(), which_mutual()
  • es → edges: ends(), head_of(), tail_of()
  • e → edges: edge_betweenness()

All of these are head arguments, or belong to functions without ..., so positional calls keep working without a warning, and the old name stays as a trailing deprecated() formal. edge_betweenness(), ends(), subgraph_from_edges() and which_mutual() have registry entries, so the generated block handles the rename (see #2859). count_multiple(), head_of(), tail_of(), reverse_edges(), which_loop() and which_multiple() have none and use a hand-written bridge. Either way, a call that uses the old name gets one soft-deprecation, and an error if both spellings are supplied.

edges is also the constructor input of make_graph() and friends, but no function has both meanings, so there is no clash.

Internal callers (E() via ends()) and the tests use the new names. There are new tests for the legacy spellings, and tests/testthat/test-basic.R is new because head_of()/tail_of() had no tests.

The deprecated wrappers (is.mutual(), is.multiple(), is.loop(), count.multiple()) are untouched. They keep forwarding eids = , which is recovered silently, because the soft deprecation only fires for user calls.

Not in this PR

  • No function takes a single edge as an argument, so there is nothing to rename to edge.
  • index in the edge-attribute accessors comes in the next PR.

The #2788 stack

Each PR is based on the previous one and merges in this order:

  1. refactor: Rename algo to algorithm in page_rank(), feedback_arc_set() and feedback_vertex_set() #2859: algo → algorithm
  2. refactor: Rename nodes to n in generators and centr_*_tmax() #2860: nodes → n (vertex counts)
  3. refactor: snake_case weights arguments in clique functions and cluster_infomap() #2861: weights arguments
  4. refactor: Rename normalization flags to normalized #2862: normalization flags → normalized
  5. refactor: Purge legacy alias formals via the migration registry #2863: hand-rolled alias formals into the registry
  6. refactor: Rename vertex-selector arguments to vertices and vertex #2864: selectors → vertices/vertex
  7. refactor: Rename edge-selector arguments to edges #2943: edge selectors → edges ← this PR
  8. refactor: Rename index to vertices/edges in the attribute accessors #2944: attribute accessors: index → vertices/edges
  9. refactor: Rename iteration arguments to n_iter/max_iter #2945: iterations → n_iter/max_iter
  10. refactor: snake_case the dotted arguments of the graph generators and degree-sequence functions #2946: snake_case: generators and degree sequences
  11. refactor: snake_case the dotted arguments of the layout functions #2947: snake_case: layouts
  12. refactor: snake_case the dotted arguments of the community, HRG, motif and graphlet functions #2948: snake_case: community, HRG, motifs, graphlets (Mu → mu)
  13. refactor: snake_case the dotted arguments of the structural and conversion functions #2950: snake_case: structural and conversion functions
  14. refactor: Rename algorithm-selection arguments to algorithm and measure selection to measure #2951: algorithm family → algorithm/measure (closes Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation #2932)

🤖 Generated with Claude Code

schochastics and others added 2 commits October 15, 2026 21:20
`eids`, `es` and `e` unify on `edges` in `count_multiple()`,
`reverse_edges()`, `subgraph_from_edges()`, `which_loop()`,
`which_multiple()`, `which_mutual()`, `ends()`, `head_of()`, `tail_of()`
and `edge_betweenness()`, mirroring `vertices`.
Named legacy calls are recovered with a soft-deprecation.

Part of #2788.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The frozen wrapper forwards `eids = `, which now also soft-deprecates.

Part of #2788.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 332c66b is merged into claude/issue-2788-subagents-faw1t1-6:

  • ✔️E_named: 231ms -> 233ms [-1.47%, +3.04%]
  • ✔️V_named: 432ms -> 432ms [-0.32%, +0.36%]
  • ✔️all_simple_paths_named: 155ms -> 154ms [-1.54%, +0.26%]
  • ❗🐌as_adjacency_matrix: 244ms -> 246ms [+0.02%, +1.17%]
  • ✔️as_biadjacency_matrix: 259ms -> 258ms [-0.9%, +0.41%]
  • ✔️as_data_frame_both: 261ms -> 262ms [-0.3%, +0.95%]
  • ✔️as_long_data_frame: 215ms -> 216ms [-0.73%, +1.48%]
  • ✔️ego_order2_named: 170ms -> 171ms [-0.4%, +2.55%]
  • ❗🐌es_attr_assign: 236ms -> 238ms [+0.34%, +1.29%]
  • ✔️es_attr_filter: 245ms -> 245ms [-0.69%, +0.85%]
  • ✔️graph_from_adjacency_matrix: 277ms -> 279ms [-0.28%, +1.38%]
  • ✔️graph_from_data_frame: 284ms -> 285ms [-0.06%, +1.17%]
  • ❗🐌head_of_named: 180ms -> 184ms [+1.06%, +3.02%]
  • ✔️incident_edges: 214ms -> 214ms [-0.79%, +0.69%]
  • ✔️max_cliques_named: 26.6ms -> 26.7ms [-0.84%, +1.22%]
  • ✔️neighbors_by_name: 323ms -> 322ms [-0.78%, +0.49%]
  • ✔️union_named: 240ms -> 241ms [-1.74%, +2.47%]
  • ✔️vs_attr_filter: 330ms -> 329ms [-0.99%, +0.09%]
  • ✔️vs_by_name: 302ms -> 303ms [-0.43%, +0.86%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 64f018c is merged into claude/issue-2788-subagents-faw1t1-6:

Status Name Current Incoming Interval
✔️ V_named 371ms 369.6ms [-2.32%, +1.56%]
✔️ graph_from_adjacency_matrix 250.5ms 252.5ms [-0.89%, +2.54%]
✔️ graph_from_data_frame 241ms 239.2ms [-2.08%, +0.54%]
✔️ es_attr_filter 209.7ms 208ms [-2.19%, +0.58%]
✔️ es_attr_assign 203.5ms 203.8ms [-0.67%, +1.02%]
✔️ as_biadjacency_matrix 201.6ms 201.5ms [-1.86%, +1.82%]
✔️ vs_subset_positional 195.3ms 193.5ms [-2.13%, +0.37%]
✔️ as_adjacency_matrix 191.1ms 192.1ms [-1.7%, +2.7%]
✔️ E_named 190.2ms 189.7ms [-1.85%, +1.31%]
✔️ vs_by_name 180.3ms 179.9ms [-1.72%, +1.35%]
✔️ as_data_frame_both 174.6ms 174.6ms [-1.84%, +1.88%]
✔️ max_cliques_sizes_named 174.8ms 174.5ms [-0.76%, +0.46%]
✔️ as_long_data_frame 163ms 163.4ms [-0.48%, +0.91%]
✔️ union_named 154.7ms 155.1ms [-0.48%, +0.98%]
❗🐌 head_of_named 145.5ms 148.2ms [+0.28%, +3.4%]
✔️ vs_attr_filter 147.4ms 147.5ms [-0.87%, +1.08%]
✔️ incident_edges 139.9ms 139.1ms [-1.62%, +0.58%]
✔️ ego_order2_named 134.7ms 134.4ms [-0.9%, +0.52%]
✔️ neighbors_by_name 109.9ms 110.5ms [-0.37%, +1.5%]
✔️ all_simple_paths_named 109.8ms 109ms [-1.92%, +0.61%]
✔️ vs_by_literal_name 80.2ms 79.6ms [-4.11%, +2.53%]
✔️ degree_few_vertices 72.3ms 72.5ms [-0.3%, +0.81%]
✔️ strength_weighted_named 25.4ms 25.4ms [-0.99%, +0.6%]
✔️ max_cliques_named 22.7ms 22.2ms [-6.7%, +2.27%]

Further explanation regarding interpretation and methodology can be found in the documentation.

Last updated for commit 64f018c.

schochastics and others added 5 commits December 2, 2026 21:10
The @return text still named the `e` argument, renamed to `edges` here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-2788-subagents-faw1t1-7

# Conflicts:
#	tests/testthat/test-interface.R
#	tests/testthat/test-structural-properties.R
@schochastics schochastics reopened this Dec 3, 2026
schochastics and others added 8 commits December 3, 2026 11:20
…-2788-subagents-faw1t1-7

# Conflicts:
#	tests/testthat/_snaps/structural-properties.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator re-matches a call that uses an old head name against the old
signature, so the hand-written bridges for registered functions are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schochastics schochastics reopened this Dec 3, 2026
@schochastics
schochastics merged commit 0bfe350 into main Dec 3, 2026
12 checks passed
@schochastics
schochastics deleted the claude/issue-2788-subagents-faw1t1-7 branch December 3, 2026 20:01
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Co-authored-by: schochastics <schochastics@users.noreply.github.com>
(cherry picked from commit 0bfe350)
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Co-authored-by: schochastics <schochastics@users.noreply.github.com>
(cherry picked from commit 0bfe350)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation

2 participants